from fastapi import APIRouter
from pydantic import BaseModel
from intelli_port.content import publish_to_xhs
from intelli_port.content import schedule_daily


router = APIRouter()


class PublishRequest(BaseModel):
    doc: str
    images: list[str] = []


@router.post("/xhs/publish")
async def xhs_publish(req: PublishRequest):
    return publish_to_xhs(req.doc, req.images)


class ScheduleRequest(BaseModel):
    times: list[str]


@router.post("/xhs/schedule")
async def xhs_schedule(req: ScheduleRequest):
    return schedule_daily(req.times)